// /projectSet/getProjectSetPage
// 项目建设模块接口
import request from '@/http/request'
import axios from 'axios'
const apiUrl = 'bf-project'
const apiUserUrl = 'bf-user'
// -----------项目集接口----------
export const projectApi = {
  getAssetsPage: (param) =>
    request.post(`${apiUrl}/projectSet/getProjectSetPage`, param), // 分页查询
  getProjectSetListTree: (param) =>
      request.post(`${apiUrl}/projectSet/getProjectSetListTree`, param), //  项目集树形结构查询
  addProjects: (param) => request.post(`${apiUrl}/projectSet/create`, param), // 新增
  editProjects: (param) => request.post(`${apiUrl}/projectSet/update`, param), // 编辑
  getByidProjects: (param) =>
    request.get(`${apiUrl}/projectSet/getProjectSet?projectSetId=${param}`), // 获取详情信息
  getProjectInfo: (param) =>
    request.get(`${apiUrl}/projectSet/getProjectInfo?projectSetId=${param}`), // 项目明细
  deleteProjects: (param) =>
    request.get(`${apiUrl}/projectSet/remove?projectSetId=${param}`), // 删除
  getProjectSetBelong: () =>
      request.get(`${apiUrl}/projectSet/getProjectSetBelong`), // 获取所有项目集归属，不分页
}
// -----------项目接口----------
export const projectListApi = {
  getAllList: (param) =>
    request.get(`${apiUrl}/project/getProjects?projectSetId=${param}`), // 获取项目所有信息
  getProjectsByType: (param) => request.get(`${apiUrl}/project/getProjectsBytype`,{params:param}), // 获取分类所有项目
  getprojectByid: (param) =>
    request.get(`${apiUrl}/project/getProjectDetail?projectId=${param}`), // 获取项目所有信息
  getprojectPage: (param) =>
    request.post(`${apiUrl}/project/getProjectPage`, param) // 获取项目分页
}
// -----------会议接口----------
export const mettingApi = {
  getPage: (param) =>
    request.post(`${apiUrl}/system/bfProjectItemMeeting/page`, param), // 立项会议分页
  fileExport: (param) =>
    request.get(
      `${apiUrl}/system/bfProjectItemMeeting/export?meetingName=${param?.meetingName || ''
      }&projectId=${param?.projectId || ''}`,
      { responseType: 'blob' }
    ) // 附件导出
}
// -----------质量监督----------
export const qualitySupervision = {
  getPage: (param) =>
    request.post(`${apiUrl}/problem/getQualityProblemPage`, param), // 获取分页
  addQuality: (param) => request.post(`${apiUrl}/problem/create`, param), // 新增
  updateQualityProblem: (param) =>
    request.post(`${apiUrl}/problem/updateQualityProblem`, param), // 编辑
  dealProblem: (param) => request.post(`${apiUrl}/problem/deal`, param), // c处理
  dealsave: (param) => request.post(`${apiUrl}/problem/deal/save`, param), // c处理保存
  getQualityProblem: (param) =>
    request.get(
      `${apiUrl}/problem/getQualityProblem?qualityProblemId=${param}`
    ), // 编辑获取详情
  removeProblem: (param) =>
    request.get(`${apiUrl}/problem/remove?qualityProblemId=${param}`), // 删除
  checkProblem: (param) =>
    request.get(
      `${apiUrl}/problem/check?qualityProblemId=${param.qualityProblemId}&checkStatus=${param.checkStatus}`
    ), // 编辑获取详情
  getAndDealDetail: (param) =>
    request.get(
      `${apiUrl}/problem/getQualityProblemAndDealDetail?qualityProblemId=${param}`
    ), // 处理中查看详情
  history: (param) =>
    request.get(`${apiUrl}/problem/history?qualityProblemId=${param}`), // 处理中查看详情
  type: (param) => request.get(`${apiUrl}/problem/type?parentId=${param}`) // 处理中查看详情
}
// -----------首页----------
export const homeApi = {
  getUserTask: (param) => request.get(`${apiUrl}/overview/getUserTask`,{params:param}), // 我的任务
  getUserProject: (param) =>
    request.get(`${apiUrl}/overview/getUserProject`,{params:param}), // 我参与的项目
  getOverviewStatistics: (param) =>
    request.get(`${apiUrl}/overview/getOverviewStatistics`,{params:param}), // 获取项目概览统计
  getNowTime: (param) => request.get(`${apiUrl}/overview/getNowTime`,{params:param}) // 获取时间
}
// --------项目管理(预备项目管理,正式项目管理) ------------
export const projectConfigApi = {
  getProjectSets: (param) => request.get(`bf-project/projectSet/getProjectSets`,{params:param}), // 获取所有项目集，不分页
  getAllList: (param) =>
    request.get(`${apiUrl}/project/getProjects?projectSetId=${param}`), // 获取项目所有信息
  getTypeList: (param) =>
    request.get(`${apiUrl}/public/type/list?parentId=${param}`), // 获取某项目类型的子列表
  prepareRemove: (param) =>
    request.get(`${apiUrl}/project/prepare/remove?projectId=${param}`), // 删除预备项目
  getProjectPage: (param) =>
    request.post(`${apiUrl}/project/getProjectPage`, param), // 根据预备状态获取项目分页（-1预备项目1已立项项目）
  prepareUpdate: (param) =>
    request.post(`${apiUrl}/project/prepare/update`, param), // 编辑预备项目
  prepareCreate: (param) =>
    request.post(`${apiUrl}/project/prepare/create`, param), // 新增预备项目
  addOne: (param) =>
    request.post(`bf-investment/projectInvestment/addOne`, param), // 保存投资项目

  getProjectDetail: (param) =>
    request.get(`${apiUrl}/project/getProjectDetail?projectId=${param}`), // 获取预备项目详情->基础信息
  bfProjectSubjectMeetingView: (param) =>
    request.get(
      `${apiUrl}/system/bfProjectSubjectMeeting/view?projectId=${param}`
    ), // 立项议题查看  (预备)
  bfProjectSubjectMeetingAdd: (param) =>
    request.post(`${apiUrl}/system/bfProjectSubjectMeeting/add`, param), // 立项议题新增  (预备)
  bfProjectSubjectMeetingEdit: (param) =>
    request.post(`${apiUrl}/system/bfProjectSubjectMeeting/edit`, param), // 立项议题新增  (预备)
  bfProjectApprovalFormView: (param) =>
    request.get(
      `${apiUrl}/system/bfProjectApprovalForm/view?projectId=${param}`
    ), // 立项审批
  bfProjectApprovalTaskFormView: (param) =>
    request.get(
      `${apiUrl}/system/bfProjectApprovalForm/view?projectId=${param.projectId}&taskId=${param.taskId}&itemId=${param.itemId}`
    ), // 获取立项请示决策会议详情
  bfProjectApprovalTaskAddTask: (param) =>
    request.post(
      `${apiUrl}/system/bfProjectApprovalForm/addTask`, param
    ), // 获取立项请示决策会议详情
  bfProjectApprovalFormAdd: (param) =>
    request.post(`${apiUrl}/system/bfProjectApprovalForm/add`, param), // 立项审批新增  (预备)
  bfProjectApprovalFormEdit: (param) =>
    request.post(`${apiUrl}/system/bfProjectApprovalForm/edit`, param), // 立项审批新增  (预备)
  getStage: (param) =>
    request.get(`${apiUrl}/project/getStage?projectId=${param}`), // 项目看板
  getStage2: (param) =>
      request.get(`${apiUrl}/project/getStage`,{params:param}), // 项目看板
  updateProject: (param) => request.post(`${apiUrl}/project/update`, param), // 更新正式项目

  getConferencePage: (param) =>
    request.post(`${apiUrl}/system/bfProjectMeeting/page`, param), // 正式项目会议信息
  getConferenceView: (param) =>
    request.get(`${apiUrl}/system/bfProjectMeeting/view?id=` + param), // 正式项目会议信息  查看

  // 资料成果
  getProjectPageList: (param) =>
    request.post(`${apiUrl}/project/file/getProjectPageList`, param), // 获取项目分页列表
  getFilePageList: (param) =>
    request.post(`${apiUrl}/project/file/getFilePageList`, param), // 获取项目文件分页列表
  getDownloadLogList: (param) =>
    request.get(`${apiUrl}/project/file/getDownloadLogList?projectId=` + param), //   获取文件下载记录列表
  getItemList: (param) =>
    request.get(`${apiUrl}/task/item/list?projectTaskId=` + param), //   项目实施任务节点规划 列表
  taskItemCreate: (param) =>
    request.post(`${apiUrl}/task/item/create`, param), //   项目实施任务节点规划 新增

  taskItemUpdate: (param) =>
    request.post(`${apiUrl}/task/item/update`, param), //   项目实施任务节点规划 新增
  getActionList: (param) =>
    request.get(`${apiUrl}/task/item/action/list`), //   行为列表
  getTaskInfo: (param) =>
    request.get(`${apiUrl}/task/info?projectTaskId=` + param,), //   任务详情
  OASync: (param) =>
    request.get(`${apiUrl}/task/oa/sync?projectTaskId=` + param,), //   任务同步到OA


  // 获取项目类型列表
  getProjectTypeCountt: (param) =>
    request.post(`${apiUrl}/system/cockpit/getProjectTypeCountt`, param), // 获取项目文件分页列表
  updateGovernment: (param) => request.post(`${apiUrl}/project/updateGovernment`, param), //   政府类项目-更新正式项目
  createDarkProject: (param) => request.post(`${apiUrl}/project/dark/create`, param), //  生成暗线项目
  governmentFiles: (param) => request.get(`${apiUrl}/project/governmentFiles?projectId=${param.projectId}`), //  政府任务通知书
}
// -----------任务督办----------
export const taskSupervise = {
  getPageList: (param) =>
    request.post(`${apiUrl}/task/report/getMyPageList`, param), // 分页查询
  getSh: (param) =>
    request.post(`${apiUrl}/task/report/getAuditPageList`, param), // 审核列表
  save: (param) => request.post(`${apiUrl}/task/report/overdue/save`, param), // 上报保存
  completeSave: (param) =>
    request.post(`${apiUrl}/task/report/complete/save`, param), // 完成保存
  audit: (param) => request.post(`${apiUrl}/task/report/audit`, param), // 审核
  getInfo: (param) =>
    request.get(`${apiUrl}/task/report/info?projectTaskId=${param}`) // 详情
}
// -----------进场人员----------
export const approachApi = {
  getPageList: (param) =>
    request.post(`${apiUrl}/stage/worker/getWorkerPage`, param), // 分页查询
  savePeople: (param) => request.post(`${apiUrl}/stage/worker/create`, param), // 新增

  getPeople: (param) =>
    request.get(`${apiUrl}/stage/worker/getWorkerDetail?workerId=${param}`), // 查看详情
  deletePeople: (param) =>
    request.get(`${apiUrl}/stage/worker/delete`,{params:param}), // 删除进场人员
}
// -----------项目阶段----------
export const projectPhase = {
  getProjectPhase: (param) =>
    request.get(
      `${apiUrl}/stage/getStage?projectId=${param.projectId}&projectTypeId=${param.projectTypeId}`
    ),
  getProjectPhase2: (param) =>
      request.get(
          `${apiUrl}/stage/getPublicStage?projectId=${param.projectId}&projectTypeId=${param.projectTypeId}`
      ),
  // 项目阶段
  savePeople: (param) => request.post(`${apiUrl}/stage/worker/create`, param), // 新增 新增项目阶段进场人

  stageCreate: (param) => request.post(`${apiUrl}/stage/create`, param), // 新增项目实施单个阶段
  stageUpdate: (param) => request.post(`${apiUrl}/stage/update`, param), // 更新项目实施单个阶段
  stageRemove: (param) =>
    request.get(
      `${apiUrl}/stage/remove?projectId=${param.projectId}&projectStageId=${param.projectStageId}`
    ), // 移除单个项目阶段
  createStage:(param)=> request.post(`${apiUrl}/stage/batch/create`, param), // 批量新增项目阶段
}
// -----------部门&人员信息----------
export const department = {
  departmentExport: (param) => request.get(`${apiUserUrl}/weekly/department/write/export`,{params:param,responseType: 'blob'}), // 部门周报详情导出
  getProjectPhase: (param) =>
    request.get(`${apiUserUrl}/department/getDepartmentTree`), // 项目阶段
  getAllDepartments: (param = '') =>
    request.get(`${apiUserUrl}/department/getAllDepartments`), // 获取部门
  getSearchDepartments: (param = '') =>
    request.get(`${apiUserUrl}/department/searchDepartments?departmentName=${param || ''}`), // 获取部门
  getUserByDepartmentId: (param,userName='') =>
    request.get(
      `${apiUserUrl}/user/getUserByDepartmentId?departmentId=${param}&userName=${userName}`
    ), // 根据部门获取人员
  getLeaderByDepartmentId: (param) =>
    request.get(
      `${apiUserUrl}/user/getLeaderByDepartmentId?departmentId=${param}`
    ), // 根据部门获取人员
  savePeople: (param) => request.post(`${apiUrl}/stage/worker/create`, param) // 新增
}
// -----------获取项目类别----------
// public
export const publicProject = {
  getProjectTypeTreeVo: (param) =>
    request.get(`${apiUrl}/public/type/getProjectTypeTreeVo`), // 项目类型树

  getProjectTypeVo: (param) =>
    request.get(`${apiUrl}/public/type/getProjectTypeVo`), // 获取项目类型用于下拉框

  getByIdProjectType: (param) =>
    request.get(`${apiUrl}/public/type/getProjectType?projectTypeId=` + param), // 编辑时获取项目类型信息
  typeRemove: (param) =>
    request.get(`${apiUrl}/public/type/remove?projectTypeId=` + param), // 编辑时获取项目类型信息
  getStage: (param) =>
    request.get(`${apiUrl}/public/stage/getStage?projectTypeId=` + param), // 编辑时获取项目类型信息
  getProjectTypePage: (param) =>
    request.post(`${apiUrl}/public/type/getProjectTypePage`, param), // 获取项目实施阶段配置
  publicTypeCreate: (param) =>
    request.post(`${apiUrl}/public/type/create`, param), // 获取项目实施阶段配置
  publicTypeUpdate: (param) =>
    request.post(`${apiUrl}/public/type/update`, param), // 获取项目实施阶段配置
  stageCreate: (param) => request.post(`${apiUrl}/public/stage/create`, param), // 新增配置
  stageUpdate: (param) => request.post(`${apiUrl}/public/stage/update`, param), // gengx配置
  stageRemove: (param) =>
    request.get(`${apiUrl}/public/stage/remove?stageId=` + param) // shanchu配置
}
// -----------项目对应阶段信息----------
export const projectTask = {
  getTaskInfo:(param) => request.get(`${apiUrl}/task/info`,{params:param}),
  getStageDetail: (param) =>
    request.get(`${apiUrl}/task/getStageDetail?projectId=${param}`), // 项目阶段对应项目信息
  removeTask: (param) =>
    request.get(`${apiUrl}/task/removeTask?projectTaskId=${param}`), // 项目阶段对应项目信息
  getProjectTaskPage: (param) =>
    request.post(`${apiUrl}/task/getProjectTaskPage`, param), // 项目阶段对应项目信息
  addProjectTask: (param) => request.post(`${apiUrl}/task/createTask`, param), // 项目阶段对应项目信息
  updateTaskOrder: (param) =>
    request.post(`${apiUrl}/task/updateTaskOrder`, param), // 上下移动
  updateTask: (param) => request.post(`${apiUrl}/task/updateTask`, param), // 编辑
  effectTask: (param) => request.post(`${apiUrl}/task/effect`, param) // 任务派发
  // getProjectTaskPage: (param) =>request.post(`${apiUrl}/task/getProjectTaskPage`,param), // 项目阶段对应项目信息
}

// -----------首页待办事项相关接口----------
export const homeToDoPage = {
  // gerToDoList: (param) =>
  //   request.get(`${apiUserUrl}/msg/project/getUnreadProjectMsg?businessType=1`), // 项目阶段对应项目信息
  gerToDoList: (param) =>
    request.get(`${apiUrl}/overview/getItem`,{params:param}), // 项目阶段对应项目信息
  getProjectMsgPage: (param) =>
    request.post(`${apiUserUrl}/msg/project/getProjectMsgPage`, param), // 项目阶段对应项目信息
  getMyProjectMsgPage: (param) =>
    request.post(`${apiUserUrl}/msg/project/getProjectMsgPage`, param), // 项目阶段对应项目信息
  updateStatus: (param) =>
    request.post(`${apiUserUrl}/msg/project/updateStatus`, param) // 标记已读&标记未读
}
// -----------周报相关接口----------
export const weeklyApi = {
  departmentExportDetails: (departmentWeeklyId) => request.get(`bf-user/weekly/department/write/export?departmentWeeklyId=${departmentWeeklyId}`, { responseType: 'blob' }), // 周报详情 导出
  departmentExportList: (param) => request.get(`bf-user/weekly/department/export`, { params:param,responseType: 'blob' }), // 周报列表 导出

  getWeekPageList: (param) =>
    request.post(`${apiUserUrl}/weekly/department/getWeeklyPage`, param), // 周报分页查询
  createWeekly: (param) =>
    request.post(`${apiUserUrl}/weekly/department/createWeekly`, param), // 项目阶段对应项目信息
    updateWeekly: (param) =>
    request.post(`${apiUserUrl}/weekly/department/updateWeekly`, param), // 编辑
    deleteWeekly: (param) =>
    request.post(`${apiUserUrl}/weekly/department/deleteWeekly`, param), // 删除
  getWeekly: (param) =>
    request.get(
      `${apiUserUrl}/weekly/department/getWeekly?departmentWeeklyId=${param}`
    ), // 项目阶段对应项目信息
  getWeeklyWrite: (param) =>
    request.get(
      `${apiUserUrl}/weekly/department/getWeeklyWrite?departmentWeeklyId=${param}`
    ), // 获取建设部门周报填写记录
  updateWeeklyStatus: (param) =>
    request.get(
      `${apiUserUrl}/weekly/department/updateWeeklyStatus?departmentWeeklyId=${param}`
    ), // 下发
  createWeeklyWrite: (param) =>
    request.post(`${apiUserUrl}/weekly/department/createWeeklyWrite`, param), // 新增
  updateWeeklyWrite: (param) =>
    request.post(`${apiUserUrl}/weekly/department/updateWeeklyWrite`, param) // 更新
}
// -----------资金管理----------
export const fundApi = {
  getWeekPageList: (param) =>
    request.post(`${apiUrl}/fund/budget/plan/page/list`, param), // 项目资金预算管理分页列表
  getDetailPageList: (param) =>
    request.post(`${apiUrl}/fund/budget/plan/detail/page/list`, param) // 款项结算记录分页列表
}
// -----------首页待办事项相关接口----------
export const messageApi = {
  getConfig: (param) =>
    request.get(`${apiUrl}/system/getConfig?configType=` + param), // 获取任务通知配置
  saveConfig: (param) => request.post(`${apiUrl}/system/saveConfig`, param),// 更新或新增任务通知配置
  deleteById: (param) => request.post(`${apiUrl}/system/deleteById`, param) // 删除 通知
}
// -----------用户相关接口----------
export const userApi = {
  getAlluserList: (param) =>
    request.get(`${apiUserUrl}/user/searchUsers?userName=` + param) // 获取所有用户
}

// -----------驾驶舱相关接口----------
export const systemApi = {
  getProjectNum: (param) =>
    // bf-project/system/cockpit/getProjectCount
    request.get(`${apiUrl}/system/cockpit/getProjectCount`), // 项目进展
  getFundCount: (param) => request.get(`${apiUrl}/system/cockpit/getFundCount`), // 项目资金
  getQualityCount: (param) =>
    request.get(`${apiUrl}/system/cockpit/getQualityCount`), // 质量监督
  getRedOrBlackCount: (param) =>
    request.get(`${apiUrl}/system/cockpit/getRedOrBlackCount`), // 红黑榜
  getStageCount: (param) =>
    request.get(`${apiUrl}/system/cockpit/getStageCount`) // 项目阶段
}

// ------------导出 ----------------
export const deriveApi = {
  preparatoryProjectExport:(param)=> request.get(`${apiUserUrl}/project/prepare/export`,{params:param,responseType: 'blob'}), // 预备项目 导出
  buildDepartmentExport: (param) =>
    request.get(
      `${apiUserUrl}/weekly/department/export?startTime=${param.startTime || ''
      }&endTime=${param.endTime || ''}`,
      { responseType: 'blob' }
    ), // 周报 导出
  contractExport: (param) =>
    request.get(
      `${apiUrl}/system/bfProjectActionApplyContract/export?projectStageId=${param.projectStageId || ''
      }&keywords=${param.keywords || ''}`,
      { responseType: 'blob' }
    ), // 合同 导出
  contractCheck: (param) =>
    request.get(
      `${apiUrl}/system/bfProjectActionApplyContract/ledger/export?keywords=${param.keywords || ''
      }&startTime=${param.startTime || ''}&endTime=${param.endTime || ''}`,
      { responseType: 'blob' }
    ), // 合同台账 导出
  //周报详情导出
  departmentExport: (param) => {
    console.log(param);

    return request.get(
      `${apiUserUrl}/weekly/department/export?departmentWeeklyId=${param.departmentWeeklyId}`,
      { responseType: 'blob' }
    )
  },
  //进场人员导出
  exportPeople: (param) => request.get(`${apiUrl}/stage/worker/export?projectStageId=${param.projectStageId}&workerName=${param.workerName || ''}`, { responseType: 'blob' }), // 导出
  //进场人员导入
  importPeople: (param) => request.post(`${apiUrl}/stage/worker/import`, param, { responseType: 'blob' }), // 导出

  problemExport: (param) =>
    request.get(
      `${apiUrl}/problem/export?projectName=${param.projectName || ''
      }&dealDepartmentId=${param.dealDepartmentId || ''}&projectId=${param.projectId || ''
      }`,
      { responseType: 'blob' }
    ), // 质量监督 导出
  systemExport: (param) =>
    request.post(`${apiUrl}/system/bfProjectMeeting/export`, param, {
      responseType: 'blob'
    }), // 会议 导出

  projectSetExport: (param) =>
    request.get(
      `${apiUrl}/projectSet/export?projectName=${param.projectName || ''
      }&projectTypeId=${param.projectTypeId || ''}`,
      { responseType: 'blob' }
    ), // 项目集 导出
  projectExport: (param) =>
    request.get(
      `${apiUrl}/project/export?prepareStatus=${param.prepareStatus || ''
      }&projectQuery=${param.projectQuery || ''}&projectSetId=${param.projectSetId || ''
      }&projectTypeId=${param.projectTypeId || ''}&regionCode=${param.regionCode || ''}&status=${param.status || ''}&year=${param.year || ''}&type=${param.type || ''}`,
      { responseType: 'blob' }
    ), // 项目 导出
  taskExport: (param) =>
    request.get(
      `${apiUrl}/task/export?projectStageId=${param.projectStageId}&projectId=${param.projectId || ''
      }`,
      { responseType: 'blob' }
    ), // 项目任务 导出
  taskExport2: (param) =>
      request.get(
          `${apiUrl}/dark/task/export`,
          { responseType: 'blob',params:param }
      ), // 项目任务 导出
  taskDBExport: (param) =>
    request.get(
      `${apiUrl}/task/report/export?keywords=${param.keywords || ''
      }&projectTypeId=${param.projectTypeId || ''}`,
      { responseType: 'blob' }
    ) // 任务督办 导出
}
// ------------招标议题 ----------------
export const biddingApi = {
  biddingLook: (param) =>
    request.get(
      `${apiUrl}/system/bfProjectProblemApproval/view?projectId=${param.projectId || ''
      }&taskId=${param.taskId || ''}&itemId=${param.itemId || ''}`
    ), // 招标议题查看
  biddingAdd: (param) =>
    request.post(`${apiUrl}/system/bfProjectProblemApproval/add`, param) // 招标议题新增
}
// ------------业务议题 ----------------
export const businessApi = {
  businessLook: (param) =>
    request.get(
      `${apiUrl}/system/bfProjectBusinessRequest/view?projectId=${param.projectId || ''
      }&taskId=${param.taskId || ''}&itemId=${param.itemId || ''}`
    ), // 业务议题查看
  businessAdd: (param) =>
    request.post(`${apiUrl}/system/bfProjectBusinessRequest/add`, param) // 业务议题新增
}
// ------------服务商比选 ----------------
export const serviceApi = {
  serviceLook: (param) =>
    request.get(
      `${apiUrl}/system/bfTenderTaskReference/view?projectId=${param.projectId || ''
      }&itemId=${param.itemId || ''}&taskId=${param.taskId || ''}`
    ), // 服务商比选查看
  serviceAdd: (param) =>
    request.post(`${apiUrl}/system/bfTenderTaskReference/add`, param) // 服务商比选新增
}
// ------------合同初稿 ----------------
export const contractApi = {
  contractLook: (param) =>
    request.get(
      `${apiUrl}/system/bfProjectActionApplyContract/view?projectId=${param.projectId || ''
      }&taskId=${param.taskId || ''}&itemId=${param.itemId || ''}`
    ), // 合同初稿查看
  contractAdd: (param) =>
    request.post(`${apiUrl}/system/bfProjectActionApplyContract/add`, param), // 合同初稿新增
  //合同账单明细查看
  lookContract: (param) =>
    request.get(
      `${apiUrl}/system/bfProjectActionApplyContract/getBill?contractId=${param}`
    ), // 合同初稿新增

  pageList: (param) =>
    request.post(
      `${apiUrl}/system/bfProjectActionApplyContract/page/list`,
      param
    ), // 合同初稿新增
  ledgerpageList: (param) =>
    request.post(
      `${apiUrl}/system/bfProjectActionApplyContract/ledger/page/list`,
      param
    ) // 合同台账分页
}
// ------------项目实施任务管理 ----------------
export const projectTaskApi = {
  sortUpdate: (param) =>
    request.post(`${apiUrl}/task/item/sort/update`, param), //   项目实施任务节点排序
  getStageAllTask: (param) => request.get(`${apiUrl}/task/common/list?projectStageId=${param}`,), //   获取公共任务列表
  getAllTask: (param) => request.post(`${apiUrl}/task/all/list`,param), //   获取公共任务列表
  getTaskPage: (param) => request.post(`${apiUrl}/task/page/list`, param), // 获取分页
  boardLook: (param) => request.get(`${apiUrl}/task/board`,{params:param}),
  behaviorList: (param) => request.get(`${apiUrl}/task/item/action/list`),
  updateLcb: (param) =>
    request.post(`${apiUrl}/task/item/milestone/update`, param), //里程碑修改状态
  add: (param) => request.post(`${apiUrl}/task/item/create`, param), //新增节点
  delete: (param) => request.post(`${apiUrl}/task/item/delete`, param), //删除节点
  sync: (param) => request.get(`${apiUrl}/task/oa/sync?projectTaskId=${param}`), //同步OA
  projectTaskList: (param) =>
    request.get(`${apiUrl}/task/item/list?projectTaskId=${param}`),
  getInfo: (param) => request.get(`${apiUrl}/task/info?projectTaskId=${param}`), //获取详情
  auditSave: (param) => request.post(`${apiUrl}/task/item/audit/save`, param), //逾期上报保存
  auditUpdate: (param) => request.post(`${apiUrl}/task/item/audit/update`, param), //逾期上报审核
  getAuditInfo: (param) => request.get(`${apiUrl}/task/item/audit/info?itemId=${param}`) //逾期上报详情


}
// ------------实施成果 ----------------
export const implementationResult = {
  save: (param) =>
    request.post(`${apiUrl}/task/item/action/report/save`, param), // 实施成果
  getInfo: (param) =>
    request.get(
      `${apiUrl}/task/item/action/report/info?projectTaskId=${param.projectTaskId}&businessId=${param.businessId}&itemId=${param.itemId}`
    ) // 获取详情
}
// ------------合同扫描件 ----------------
export const contractResult = {
  getInfo: (param) =>
    request.get(
      `${apiUrl}/task/item/action/annex/info?projectTaskId=${param.projectTaskId}&businessId=${param.businessId}&itemId=${param.itemId}`
    ), // 扫描件详情
  save: (param) => request.post(`${apiUrl}/task/item/action/annex/save`, param) // 实施成果
}
// ------------组织会议 ----------------
export const organizeAmeeting = {
  getInfo: (param) =>
    request.get(
      `${apiUrl}/system/bfProjectMeeting/view?projectId=${param.projectId}&taskId=${param.taskId}&itemId=${param.itemId}`
    ), // 获取详情
  save: (param) => request.post(`${apiUrl}/system/bfProjectMeeting/add`, param), // 新增
  getPage: (param) =>
    request.post(`${apiUrl}/system/bfProjectMeeting/page`, param), // 新增
  getmyPage: (param) =>
    request.post(`${apiUrl}/system/bfProjectMeeting/myPage`, param) // 获取我的会议
}

/**
 * 暗线相关接口
 *
 */
export const darkLine = {
  getStage: (param) => request.get(`${apiUrl}/project/dark/getStage`,{params:param}), // 项目看板-项目阶段
  getStageDetail: (param) => request.get(`${apiUrl}/dark/task/getStageDetail`,{params:param}), // 获取当前的所有阶段，对应项目信息
  createTask: (param) => request.post(`${apiUrl}/dark/task/createTask`,param), // 新增任务
  updateTask: (param) => request.post(`${apiUrl}/dark/task/updateTask`,param), // 更新任务
  updateTaskOrder: (param) => request.post(`${apiUrl}/dark/task/updateTaskOrder`,param), // 上下移
  removeTask: (param) => request.get(`${apiUrl}/dark/task/removeTask`,{params:param}), // 删除任务
  getProjectTaskPage: (param) => request.post(`${apiUrl}/dark/task/getProjectTaskPage`,param), // 通过项目阶段获取相关任务
  createDarkProject: (param) => request.post(`${apiUrl}/project/dark/create`,param), // 生成暗线项目
  getTaskPage: (param) => request.post(`${apiUrl}/dark/task/page/list`,param), // 任务分页列表
  boardLook: () => request.get(`${apiUrl}/dark/task/board`), //统计看板
  taskList: () => request.get(`${apiUrl}/dark/task/action/list`), //行为列表
  addMeeting: (param) => request.post(`${apiUrl}/system/bfProjectMeeting/dark/add`,param), //暗线项目相关会议信息新增
  transfer: (param) => request.post(`${apiUrl}/dark/task/transfer`,param), // 同步
  getProjectList: (param) => request.get(`${apiUrl}/project/getProjectList`,{params:param}), // 获取所有正式项目

}

/**
 * 督办相关接口
 *
 */
export const superviseAndHandle = {
  mySupervisorAndMyExecution: (param) => request.post(`${apiUrl}/project/supervise/page`,param), // 我的督办/我的执行
  createSupervise: (param) => request.post(`${apiUrl}/project/supervise/create`,param), // 生成领导督办
  underSupervision: (param) => request.post(`${apiUrl}/project/supervise/standing/page`,param), // 督办台账  督办中
  getInfo: (param) => request.get(`${apiUrl}/project/supervise/info`,{params:param}), // 基础信息
  getSuperviseRecord: (param) => request.get(`${apiUrl}/project/supervise/record`,{params:param}), // 督办记录
  updateProgress: (param) => request.post(`${apiUrl}/project/supervise/updateProgress`,param), // 更新进度
}

/**
 * 设计管理系统相关接口
 *
 */
export const designProject = {
  getDesignProjectList: (param) => request.post(`${apiUrl}/design/main/page`,param), // 设计项目主要情况
  getContractPage: (param) => request.post(`${apiUrl}/design/contract/page`,param), // 合同列表
  viewContract: (param) => request.get(`${apiUrl}/design/contract/view`,{params:param}), // 查看合同
  getContractBill: (param) => request.get(`${apiUrl}/design/getBill`,{params:param}), // 合同账单
  addAndEditDesign: (param) => request.post(`${apiUrl}/design/add`,param), // 合同新增/编辑
  designProjectSchedule: (param) => request.post(`${apiUrl}/design/process/page`,param), // 设计项目进度
  editDesignProjectSchedule: (param) => request.post(`${apiUrl}/design/process/edit`,param), // 设计项目进度编辑
  designProjectChange: (param) => request.post(`${apiUrl}/design/change/page`,param), // 设计项目变更
  editDesignProjectChange: (param) => request.post(`${apiUrl}/design/change/edit`,param), // 设计项目变更编辑
}

/**
 * 新接口 2023/09/21
 *
 */
export const newApi = {
  getBigDataProjectDetail: (param) => request.get(`${apiUrl}/project/getBigDataProjectDetail`,{params:param}), // 大数据跳转项目基础信息
}
